﻿// See https://aka.ms/new-console-template for more information
using StackExchange.Redis;

Console.WriteLine("Hello, World!");


using ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
IDatabase db = redis.GetDatabase();


db.StringSet("key1", "666");
string i = db.StringGet("key1");

ISubscriber sub = redis.GetSubscriber();

var msg = "";
do
{
    msg = Console.ReadLine();
    sub.Publish("messages", msg);
} while (msg != "exist");

